package com.centanet.framework.utils;

import android.text.style.ClickableSpan;
import android.view.View;

/**
 * url点击内部跳转
 * Created by guilin on 16/4/6.
 */
public class WebClickableSpan extends ClickableSpan {

    private final String text;
    private final SpanOnClick spanOnClick;

    public WebClickableSpan(String text, SpanOnClick spanOnClick) {
        this.text = text;
        this.spanOnClick = spanOnClick;
    }

    @Override
    public void onClick(View widget) {
        spanOnClick.click(text);
    }

    public interface SpanOnClick {

        void click(String text);
    }
}
